﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>部门</title>
    <link rel="stylesheet" type="text/css" href="<%: Url.Content("~/Res/jquery-easyui-1.2.4/themes/default/easyui.css") %>"  />
    <link rel="stylesheet" type="text/css" href="<%: Url.Content("~/Res/jquery-easyui-1.2.4/themes/icon.css") %>"  />
	<script type="text/javascript" src="<%: Url.Content("~/Res/jquery-easyui-1.2.4/jquery-1.6.min.js") %>" ></script>
    <script type="text/javascript" src="<%: Url.Content("~/Res/jquery-easyui-1.2.4/jquery.easyui.min.js") %>" ></script>
    <script type="text/javascript" src="<%: Url.Content("~/Res/jquery-easyui-1.2.4/easyloader.js") %>" ></script>
    <script type="text/javascript" src="<%: Url.Content("~/Res/jquery-easyui-1.2.4/locale/easyui-lang-zh_CN.js") %>" ></script>
    <script type="text/javascript" src="<%: Url.Content("~/Scripts/JScriptCommon.js") %>" ></script>
    <script type="text/javascript">

        $(function () {
            easyloader.locale = "zh_CN"; // 本地化设置
            easyloader.theme = "gray"; // 设置主题
            using('tree', function () {
                $('#myTree').tree({
                    checkbox: true,
                    url: '../SysDepartmentTree/GetTree',
                    onClick: function (node) {
                    //  $(this).tree('toggle', node.target);
                    }
                });
            });
        });
        function getchecked() {
            //取得所有选中的节点，返回节点对象的集合
            var checkes = $("#myTree").jstree("get_checked");
            var ids = "";
            if (checkes != null) {
                if (checkes.length > 0) {
                    for (var i = 0; i < checkes.length; i++) {
                        ids += (checkes[i].id);
                        if (i < checkes.length - 1) {
                            ids += "^";
                        }
                    }

                    returnParent(ids); //每一项用 , 分割
                } else {
                    alert("请至少选择一个");
                }
            }
        }
    </script>
</head>
<body>
    <fieldset>
        <legend>
            <input id="Submit1" onclick="getchecked()" type="submit" value="选择" />
        </legend>
        <ul id="myTree">
        </ul>
    </fieldset>
</body>
</html>



